/*
 * @Description: 企业相关的接口
 * @Autor: lizhengkun
 * @Date: 2021-08-12 16:29:44
 * @LastEditTime: 2021-08-12 16:49:09
 */
import { extend } from '@/services/request';
import { ACE_ADMIN } from './constant';

const request = extend({
  prefix: ACE_ADMIN,
});

/**
 * @description: 获取企业列表
 * @param {*}
 */
export async function getEnterpriseList() {
  return request('/sys/user/listAccountUsers', {
    method: 'POST',
    contentType: 'application/json',
  });
}

export interface SwitchUserEnterpriseParam {
  tenantId: string;
}
/**
 * @description: 切换用户企业
 * @param {*}
 */
export async function switchUserEnterprise(params: SwitchUserEnterpriseParam) {
  return request(`/user/changeTenant?tenantId=${params.tenantId}`, {
    method: 'POST',
    contentType: 'application/json',
    data: { ...params },
  });
}
